package servlets;

import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import basededatos.DAO;
import dominio.Vuelo;


@SuppressWarnings("serial")
public class ServletListarVuelos extends HttpServlet{
	
	public ServletListarVuelos(){
		super();
	}
	
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
		
		DAO dao = new DAO();
		ArrayList<Vuelo> vuelos;
		
		try {
			vuelos = dao.ConsultarVuelos();
			request.getSession().setAttribute("Vuelos", vuelos);
		} catch (SQLException e) {
			e.printStackTrace();
		}


	}
}
